#include "SMPPMessagePayload.hpp"

using namespace smpp::pdu;

MessagePayload::MessagePayload(const octetString &nValue):
TLV(TLVtags::TAG_MESSAGE_PAYLOAD,nValue.size()),_Value(nValue){}

MessagePayload::MessagePayload(const MessagePayload &nMessagePayload):
TLV(nMessagePayload),_Value(nMessagePayload.getValue()){}

bool MessagePayload::operator ==(
const MessagePayload &nMessagePayload) const{
	return (TLV::operator == (nMessagePayload) && 
			_Value == nMessagePayload.getValue());
}

bool MessagePayload::operator !=(
	const MessagePayload &nMessagePayload) const{
	return !this->operator == (nMessagePayload);
}

MessagePayload &MessagePayload::operator = (
	const MessagePayload &nMessagePayload){
	if(*this == nMessagePayload)
		return *this;
	TLV::operator = (nMessagePayload);
	_Value = nMessagePayload.getValue();
	return *this;
}

void MessagePayload::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &MessagePayload::getValue() const{
	return _Value;
}
